import { useEffect } from "react";

export const CanvasDemo = () => {
  const mount = () => {
    const canvasDiv = document.querySelector("#canvasDiv");
    const canvas = document.createElement("canvas");
    canvasDiv?.appendChild(canvas);
    const ctx = canvas.getContext("2d");
    if (ctx) {
      ctx?.arc(100, 100, 50, 90, Math.PI * 2, true);
      ctx?.stroke();
    }
  };

  useEffect(() => {
    mount();
    return () => {};
  }, []);

  return <div id="canvasDiv"></div>;
};
